package com.googlecode.lookie.platform.image.format;

import java.util.HashMap;
import java.util.Map;

public class FormatRegistry
{

    private Map<String, Format> formats = new HashMap<String, Format>();

    public void addFormat( Format format )
    {
        formats.put( format.getName(), format );
    }

    public void removeFormat( Format format )
    {
        formats.remove( format.getName() );
    }

    public Format[] getFormats()
    {
        return formats.values().toArray( new Format[formats.size()] );
    }

    public Format getFormat( String name )
    {
        return formats.get( name );
    }

}
